home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / DJGPP / DJSRC111.ZIP / go32 / ed / movedata.s < prev    next >
Text File  |  1993-06-28  |  1KB  |  52 lines

  1. /* This is file MOVEDATA.S */
  2. /*
  3. ** Copyright (C) 1993 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954
  4. **
  5. ** This file is distributed under the terms listed in the document
  6. ** "copying.dj", available from DJ Delorie at the address above.
  7. ** A copy of "copying.dj" should accompany this file; if not, a copy
  8. ** should be available from where this file was obtained.  This file
  9. ** may not be distributed without a verbatim copy of "copying.dj".
  10. **
  11. ** This file is distributed WITHOUT ANY WARRANTY; without even the implied
  12. ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. */
  14.  
  15. /*    8    segsrc
  16.     12    offsrc
  17.     16    segdest
  18.     20    offdest
  19.     24    length
  20. */
  21.  
  22.     .globl    _movedata
  23. _movedata:
  24.     pushl    %ebp
  25.     movl    %esp,%ebp
  26.     pushl    %esi
  27.     pushl    %edi
  28.     pushl    %ds
  29.     pushl    %es
  30.     movw    8(%ebp),%ax
  31.     movw    %ax,%ds
  32.     movl    12(%ebp),%esi
  33.     movw    16(%ebp),%ax
  34.     movw    %ax,%es
  35.     movl    20(%ebp),%edi
  36.     movl    24(%ebp),%ecx
  37.  
  38.     jecxz    L2
  39.     cld
  40.     rep
  41.     movsb
  42. L2:
  43.  
  44.     popl    %es
  45.     popl    %ds
  46.     popl    %edi
  47.     popl    %esi
  48.     movl    8(%ebp),%eax
  49.     leave
  50.     ret
  51.  
  52.